import request from '~/utils/resquest'

//  报警数据-列表
export const alarmInfoList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/alarmInfo/list',
    method: 'GET',
    params
  })
}

// 报警数据-导出
export const alarmInfoExport = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-monitor/alarmInfo/export',
    method: 'get',
    responseType: 'blob',
    ...payload
  })

//  报警数据-详情
export const alarmInfoView = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/alarmInfo/view',
    method: 'GET',
    params
  })
}

//  设备管理-忽略
export const ignoreAlarm = <T>(params: T) => {
  return request({ url: '/api/gxsaas-monitor/alarmInfo/ignoreAlarm', method: 'POST', params })
}

//  设备管理-推送工单
export const pushOrder = <T>(params: T) => {
  return request({ url: '/api/gxsaas-monitor/alarmInfo/pushOrder', method: 'POST', params })
}

//  设备管理-合并工单
export const pushAnyOrder = <T>(params: T) => {
  return request({ url: '/api/gxsaas-monitor/alarmInfo/pushAnyOrder', method: 'POST', params })
}

//  报警名称
export const selectAlarmBoxList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/alarmInfo/selectAlarmBoxList',
    method: 'GET',
    params
  })
}

//  所属工区
export const selectAreaNameBoxList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/alarmInfo/selectAreaNameBoxList',
    method: 'GET',
    params
  })
}

//  历史报警
export const historyAlarmList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/alarmInfo/historyAlarmList',
    method: 'GET',
    params
  })
}

//  报警分析-数量
export const analysAlarmLimit = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/alarmInfo/analysAlarmLimit',
    method: 'GET',
    params
  })
}

//  报警分析-时间
export const analysAlarmDate = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/alarmInfo/analysAlarmDate',
    method: 'GET',
    params
  })
}

//  查询警报设置列表
export const alarmConfigListGet = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/hardware/alarm/alarmConfig/List',
    method: 'GET',
    params
  })
}

//  设置警报启用或忽略状态
export const alarmConfigUpdatePut = <T>(data: T) => {
  return request({
    url: '/api/gxsaas-monitor/hardware/alarm/alarmConfig/update',
    method: 'PUT',
    data
  })
}
